#ifndef HASIO_DETAIL_SCHEDULER_OPERATION_HPP
#define HASIO_DETAIL_SCHEDULER_OPERATION_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

namespace hasio {
namespace detail {

class scheduler_operation
{
public:
    void complete()
    {
        func_(this);
    }

    void destroy()
    {
        func_(this);
    }

protected:
    typedef void(*func_type)(scheduler_operation*);
    
    scheduler_operation(func_type func)
        : func_(func)
        , result_(0)
    {
    }

protected:
    friend class scheduler;
    func_type func_;
    uint32_t result_;
};
}
}

#endif // HASIO_DETAIL_SCHEDULER_OPERATION_HPP 